import React from 'react';
import { Table } from 'antd';
import { tableLocale } from '@/tool/components/PageEmpty';
import PropTypes from 'prop-types';
import styles from '../../Operate/index.less';

const SituationTable = ({ config, data, columns }) => {
  return (
    <Table
      {...config}
      bordered={true}
      tableLayout={'fixed'}
      columns={columns}
      dataSource={data}
      rowClassName={(record) => {
        return record.indentation ? styles.expandRowStyle : '';
      }}
      pagination={false}
      locale={tableLocale}
      defaultExpandAllRows={false}
      className={styles.table}
      style={{ width: '100%', background: '#fff', marginTop: '-1px', marginRight: '-1px' }}
    />
  );
};
SituationTable.propTypes = {
  config: PropTypes.object,
  data: PropTypes.array,
  columns: PropTypes.array,
};

export default SituationTable;
